package com.dqs.comment.result;

public enum ResultEnum {
    // 成功
    SUCCESS(200, "成功"),

    // 认证相关错误
    UNAUTHORIZED(401, "未授权"),
    LOGIN_FAILED(1001, "登录失败"),
    INVALID_TOKEN(1002, "无效token"),

    // 参数相关错误
    PARAM_ERROR(400, "参数错误"),
    RESOURCE_ERROR(404, "资源不存在"),
    MISSING_PARAM(1101, "缺少必要参数"),

    // 业务相关错误
    USER_NOT_EXIST(2001, "用户不存在"),
    INSUFFICIENT_PERMISSION(403, "权限不足"),

    // 服务器错误
    INTERNAL_ERROR(500, "服务器内部错误");

    private final int code;
    private final String message;

    ResultEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}